package com.cai.kcsj.controller;

import com.cai.kcsj.entity.Type;
import com.cai.kcsj.service.TypeServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @version 1.0
 * @author：蔡松坡
 * @date：2021/1/4 21 : 20
 * @package：com.cai.kcsj.controller
 */
@Controller
@RequestMapping("/router")
public class Router {
    @Autowired
    private TypeServer typeServer;

    @RequestMapping("/toUp")
    public String toUp(Model model){
        List<Type> types = typeServer.selectType();
        model.addAttribute("typeList",types);
        return "goodsup";
    }
    @RequestMapping("/toLogin")
    public String toLogin(){
        return "login";
    }
    @RequestMapping("/toRegist")
    public String toRegist(){
        return "regist";
    }

    @RequestMapping("/toIndex")
    public String toIndex(){
        return "index";
    }

    @RequestMapping("/toPreLogin")
    public String toPreLogin(){
        return "prelogin";
    }
    @RequestMapping("/toPreReg")
    public String toPreReg(){
        return "preregist";
    }
}
